﻿using FreeSql.DataAnnotations;
using System.ComponentModel;

namespace MiniJob.Entity;

/// <summary>
/// 应用信息
/// </summary>
[Index("uk_appinfo_name", "Name", true)]
[Description("应用信息")]
public class AppInfo : Entity
{
    /// <summary>
    /// 应用名称
    /// </summary>
    [Column(StringLength = 100)]
    [Description("应用名称")]
    public required string Name { get; set; }

    /// <summary>
    /// 应用描述
    /// </summary>
    [Column(StringLength = 255)]
    [Description("应用描述")]
    public string? Description { get; set; }

    /// <summary>
    /// 标签
    /// </summary>
    [Column(StringLength = 255)]
    [Description("标签")]
    public string? Tags { get; set; }

    /// <summary>
    /// 密码
    /// </summary>
    [Column(StringLength = 50)]
    [Description("密码")]
    public required string Password { get; set; }

    /// <summary>
    /// 密码加密文本
    /// </summary>
    [Column(StringLength = 36)]
    [Description("密码加密文本")]
    public required string Salt { get; set; }

    /// <summary>
    /// 任务列表
    /// </summary>
    [Navigate(nameof(JobInfo.AppId))]
    [Description("任务列表")]
    public List<JobInfo>? JobInfos { get; set; }
}
